home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------*/
- /* Header file for 64 bit factorization program. */
- /*------------------------------------------------------*/
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
-
- #define ulong unsigned long
- #define ushort unsigned short
-
- typedef ushort * Int;
-
- ulong inv(ulong,ushort);
- short qrs(ushort,ushort);
- ushort mrt(ushort,ushort);
- ulong hrt(ulong,ushort);
- ushort npr(ushort);
-
- void Add(Int,Int,Int);
- void Dif(Int,Int,Int);
- void Mul(Int,Int,Int);
- void Mulq(Int,ushort);
- void Mod(Int);
- ushort Modq(Int,ushort);
- void Divq(Int,ushort);
- void Shiftr(Int);
- short Comp(Int,Int);
- void Set(Int,ulong);
- ulong Unset(Int);
- ulong Bitsize(Int);
- ulong Gcd(Int);
-
- ushort buf[20], N[5];
- ulong bufm[20];
- double g;
-
- /*------------------------------------------------------*/
- /* Odd primes below 0x800 (and their 10*logs) */
- /*------------------------------------------------------*/
-
- ushort Prm[] = {
- 3, 11, 5, 17, 7, 20, 11, 24, 13, 26,
- 17, 29, 19, 30, 23, 32, 29, 34, 31, 35,
- 37, 37, 41, 38, 43, 38, 47, 39, 53, 40,
- 59, 41, 61, 42, 67, 43, 71, 43, 73, 43,
- 79, 44, 83, 45, 89, 45, 97, 46, 101, 46,
- 103, 46, 107, 46, 109, 46, 113, 47, 127, 48,
- 131, 48, 137, 49, 139, 49, 149, 50, 151, 50,
- 157, 50, 163, 50, 167, 51, 173, 51, 179, 51,
- 181, 51, 191, 52, 193, 52, 197, 52, 199, 52,
- 211, 53, 223, 54, 227, 54, 229, 54, 233, 54,
- 239, 54, 241, 54, 251, 55, 257, 55, 263, 55,
- 269, 55, 271, 56, 277, 56, 281, 56, 283, 56,
- 293, 56, 307, 57, 311, 57, 313, 57, 317, 57,
- 331, 58, 337, 58, 347, 58, 349, 58, 353, 58,
- 359, 58, 367, 59, 373, 59, 379, 59, 383, 59,
- 389, 59, 397, 59, 401, 59, 409, 60, 419, 60,
- 421, 60, 431, 60, 433, 60, 439, 60, 443, 60,
- 449, 61, 457, 61, 461, 61, 463, 61, 467, 61,
- 479, 61, 487, 61, 491, 61, 499, 62, 503, 62,
- 509, 62, 521, 62, 523, 62, 541, 62, 547, 63,
- 557, 63, 563, 63, 569, 63, 571, 63, 577, 63,
- 587, 63, 593, 63, 599, 63, 601, 63, 607, 64,
- 613, 64, 617, 64, 619, 64, 631, 64, 641, 64,
- 643, 64, 647, 64, 653, 64, 659, 64, 661, 64,
- 673, 65, 677, 65, 683, 65, 691, 65, 701, 65,
- 709, 65, 719, 65, 727, 65, 733, 65, 739, 66,
- 743, 66, 751, 66, 757, 66, 761, 66, 769, 66,
- 773, 66, 787, 66, 797, 66, 809, 66, 811, 66,
- 821, 67, 823, 67, 827, 67, 829, 67, 839, 67,
- 853, 67, 857, 67, 859, 67, 863, 67, 877, 67,
- 881, 67, 883, 67, 887, 67, 907, 68, 911, 68,
- 919, 68, 929, 68, 937, 68, 941, 68, 947, 68,
- 953, 68, 967, 68, 971, 68, 977, 68, 983, 68,
- 991, 68, 997, 69,1009, 69,1013, 69,1019, 69,
- 1021, 69,1031, 69,1033, 69,1039, 69,1049, 69,
- 1051, 69,1061, 69,1063, 69,1069, 69,1087, 69,
- 1091, 69,1093, 69,1097, 70,1103, 70,1109, 70,
- 1117, 70,1123, 70,1129, 70,1151, 70,1153, 70,
- 1163, 70,1171, 70,1181, 70,1187, 70,1193, 70,
- 1201, 70,1213, 71,1217, 71,1223, 71,1229, 71,
- 1231, 71,1237, 71,1249, 71,1259, 71,1277, 71,
- 1279, 71,1283, 71,1289, 71,1291, 71,1297, 71,
- 1301, 71,1303, 71,1307, 71,1319, 71,1321, 71,
- 1327, 71,1361, 72,1367, 72,1373, 72,1381, 72,
- 1399, 72,1409, 72,1423, 72,1427, 72,1429, 72,
- 1433, 72,1439, 72,1447, 72,1451, 72,1453, 72,
- 1459, 72,1471, 72,1481, 73,1483, 73,1487, 73,
- 1489, 73,1493, 73,1499, 73,1511, 73,1523, 73,
- 1531, 73,1543, 73,1549, 73,1553, 73,1559, 73,
- 1567, 73,1571, 73,1579, 73,1583, 73,1597, 73,
- 1601, 73,1607, 73,1609, 73,1613, 73,1619, 73,
- 1621, 73,1627, 73,1637, 74,1657, 74,1663, 74,
- 1667, 74,1669, 74,1693, 74,1697, 74,1699, 74,
- 1709, 74,1721, 74,1723, 74,1733, 74,1741, 74,
- 1747, 74,1753, 74,1759, 74,1777, 74,1783, 74,
- 1787, 74,1789, 74,1801, 74,1811, 75,1823, 75,
- 1831, 75,1847, 75,1861, 75,1867, 75,1871, 75,
- 1873, 75,1877, 75,1879, 75,1889, 75,1901, 75,
- 1907, 75,1913, 75,1931, 75,1933, 75,1949, 75,
- 1951, 75,1973, 75,1979, 75,1987, 75,1993, 75,
- 1997, 75,1999, 76,2003, 76,2011, 76,2017, 76,
- 2027, 76,2029, 76,2039, 76, 0, 0 };
-
- /*------------------------------------------------------*/
- /* End of file Factor64.h */
- /*------------------------------------------------------*/